#ifndef PM_SUMMARY_H_INCLUDED
#define PM_SUMMARY_H_INCLUDED

#include "pm/dbobject.h"
#include "pm/criteria.h"

namespace pm
{

/**
 * \class Summary
 */
class Summary
{
	db::ID m_idProject;
	double m_workRequest;
	double m_cost;
	double m_todo;

public:
	Summary();
	Summary(wxSQLite3ResultSet& res);
	
	db::ID id_project() const { return m_idProject; }
	double work_request() const { return m_workRequest; }
	double cost() const { return m_cost; }
	double todo() const { return m_todo; }
	double estimation() const { return m_cost + m_todo; }
	double benefit() const { return m_workRequest - m_cost - m_todo; }
};

/**
 * \class GetSummaryByProject
 */
struct GetSummaryByProject : public ICriteriaOne<Summary>
{
	db::ID  m_idProject;
	
	GetSummaryByProject(db::ID idProject);
	
	virtual wxSQLite3Statement prepare(wxSQLite3Database& db);
};

} // namespace pm

#endif // PM_SUMMARY_H_INCLUDED
